package com.example.administrator.android2019.cg6service;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.administrator.android2019.R;

public class ch6ImageActivity extends AppCompatActivity implements View.OnClickListener {

     Button btn;
     TextView tv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ch6_image);
        btn=findViewById(R.id.ch6_image_btn1);
        tv=findViewById(R.id.ch6_image_tv);
        btn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        /*开启服务，让服务区做下载图片任务*/
        Log.v("image","Activity"+Thread.currentThread().getName());
        Intent intent=new Intent(this,MyImageService.class);

        startService(intent);
    }
}
